package club.justwill.single.bean;

import club.justwill.single.impl.ToolsImpl;
import club.justwill.single.persistence.jpo.OrderItem;
import club.justwill.single.persistence.jpo.Orders;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Created by jaylon on 15-12-27.
 */
public class OrdersResp {
    private String orderId;
    private String name;
    private String phoneNumber;
    private String province;
    private String city;
    private String address;
    private String useComments;
    private String serviceComments;
    private String status;
    private String serialNumber;
    private String expressCompany;
    private String expressNumber;
    private String cover;
    private String totlalPrice;
    private String createDate;
    private List<OrderItemResp> orderItemRespList;
    private List<SkusResp> skusRespList;

    public OrdersResp() {}

    public OrdersResp(Orders orders){
        this.setOrderId(orders.getOrderId()+"");
        this.setName(orders.getName());
        this.setPhoneNumber(orders.getPhoneNumber());
        this.setProvince(orders.getProvince());
        this.setCity(orders.getCity());
        this.setAddress(orders.getAddress());
        this.setUseComments(orders.getUseComments());
        this.setServiceComments(orders.getServiceComments());
        this.setStatus(orders.getStatus()+"");
        this.setSerialNumber(orders.getSerialNumber());
        this.setExpressCompany(orders.getExpressCompany());
        this.setExpressNumber(orders.getExpressNumber());
        if(!ToolsImpl.isEmpty(orders.getOrderItemSet())){
            for(OrderItem orderItem:orders.getOrderItemSet()){
                this.getOrderItemRespList().add(new OrderItemResp(orderItem));
            }
        }

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getUseComments() {
        return useComments;
    }

    public void setUseComments(String useComments) {
        this.useComments = useComments;
    }

    public String getServiceComments() {
        return serviceComments;
    }

    public void setServiceComments(String serviceComments) {
        this.serviceComments = serviceComments;
    }


    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getExpressCompany() {
        return expressCompany;
    }

    public void setExpressCompany(String expressCompany) {
        this.expressCompany = expressCompany;
    }

    public String getExpressNumber() {
        return expressNumber;
    }

    public void setExpressNumber(String expressNumber) {
        this.expressNumber = expressNumber;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getTotlalPrice() {
        return totlalPrice;
    }
    public void setTotlalPrice(String totlalPrice) {
        this.totlalPrice = totlalPrice;
    }
    public List<OrderItemResp> getOrderItemRespList() {
        if(orderItemRespList == null) {
            orderItemRespList = new ArrayList<OrderItemResp>();
        }
        return orderItemRespList;
    }

    public void setOrderItemRespList(List<OrderItemResp> orderItemRespList) {
        this.orderItemRespList = orderItemRespList;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
    public List<SkusResp> getSkusRespList() {
        if(skusRespList == null){
            skusRespList = new ArrayList<SkusResp>();
        }
        return skusRespList;
    }

    public void setSkusRespList(List<SkusResp> skusRespList) {
        this.skusRespList = skusRespList;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }
}
